package com.zzy.librarytest.dao;

import com.zzy.librarytest.entity.Record;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ReturnRecordDao {

    @Select("select * from t_returnrecord where id=#{id}")
    Record selectOneReturnRecord(Integer id);

    @Select("select * from t_returnrecord")
    List<Record> selectAllReturnRecord();

    @Insert("insert into t_returnrecord(bookname,lendtime,returntime) values(#{bookname},#{lendtime},#{returntime})")
    Integer insertReturnRecord(Record record);

    @Delete("delete from t_returnrecord where id=#{id}")
    Integer deleteReturnRecord(Integer id);

    @Update("update t_returnrecord set bookname=#{bookname},lendtime=#{lendtime},returntime=#{returntime} where id=#{id}")
    Integer updateReturnRecord(Record record);
}
